import { defineStore } from 'pinia'
import { store } from '../index'

export const globalStore = defineStore('global', {
  state: () => {
    return {
      appId: ''
    }
  },
  getters: {
    getAppId(): String | number {
      return this.appId
    }
  },
  actions: {
    setAppId(val) {
      this.appId = val
    }
  },
  persist: true
})

export const useGlobalStore = () => {
  return globalStore(store)
}
